package com.tanhua.dubbo.api;

import com.tanhua.dubbo.mappers.ReportMapper;
import com.tanhua.dubbo.mappers.SimilarMapper;
import com.tanhua.model.domain.Report;
import com.tanhua.model.domain.UserConclusion;
import com.tanhua.model.domain.UserInfo;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDateTime;
import java.util.Date;

@DubboService
public class ReportApiImpl implements ReportApi {
    @Autowired
    private ReportMapper reportMapper;
    @Autowired
    private SimilarMapper similarMapper;
    @Autowired
    private UserInfoApi userInfoApi;
    @Override
    public void save(Report report) {
        //保存报告
        report.setCreated(LocalDateTime.now());
       reportMapper.save(report);
       // String id = report.getId();
    }

    /**
     * 根据id查报告
     * @param reportId
     * @return
     */
    @Override
    public Report getReportById(String reportId) {
        return reportMapper.selectById(reportId);

    }
}
